package com.cro.prison.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cro.prison.entity.pojo.DailyBehavior;
import com.cro.prison.entity.pojo.Discipline;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.Date;
import java.util.List;

/**
 * @author augus
 * @create 2022-11-22-14:19
 */
@Mapper
public interface DisciplineDao extends BaseMapper<Discipline> {
    @Select("select * FROM discipline as db WHERE (db.person_id = #{personId} AND db.create_time <= #{endDate} AND db.create_time >= #{beginDate})")
    List<Discipline> getDiscipline(@Param("personId") Long personId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<Discipline> listAll();
    @Select("select * FROM discipline as db WHERE (db.create_time <= #{end} AND db.create_time >= #{begin})")
    List<Discipline> getAllDiscipline(Date begin, Date end);
}
